﻿using CommunityToolkit.Mvvm.ComponentModel;
using Prism.Mvvm;
using Prism.Regions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WPF.Core
{
    /// <summary>
    /// 导航基类（实现页面导航功能 ）
    /// </summary>
    public class NavigateViewModel :ObservableObject, INavigationAware
    {
        /// <summary>
        /// 重复利用导航的对象
        /// </summary>
        /// <param name="navigationContext"></param>
        /// <returns></returns>
        public virtual bool IsNavigationTarget(NavigationContext navigationContext)
        {
            return true;
        }

        /// <summary>
        /// 当页面导航切换时
        /// </summary>
        /// <param name="navigationContext"></param>
        /// <exception cref="NotImplementedException"></exception>
        public virtual void OnNavigatedFrom(NavigationContext navigationContext)
        {
            
        }

        /// <summary>
        /// 当页面导航到达时
        /// </summary>
        /// <param name="navigationContext"></param>
        /// <exception cref="NotImplementedException"></exception>
        public virtual void OnNavigatedTo(NavigationContext navigationContext)
        {
          
        }
    }
}
